\subsection{SPARQL}
SPARQL is a query language for querying databases in the RDF format. Compared to SQL the syntax is hard to understand, and does not make much sense. However the RDF format is intended for computers and not humans. An example of an SPARQL query can be seen on listing \ref{lst:rdfque}. This query will return all capitals located in Europe. The type of data to search in is specified in line 2, and in line 5 the language of the output is specified.

\begin{code}{lst:rdfque}{Example of SPARQL query}
\begin{lstlisting}
SELECT * WHERE {
?subject rdf:type <http://dbpedia.org/class/yago/CapitalsInEurope>.
?subject rdfs:label ?label.
?subject rdfs:comment ?abstract.
FILTER (lang(?label) = "en" && lang(?abstract) = "en")
} LIMIT 20
\end{lstlisting}
\end{code}

The output of the query is a triple of each capital: Subject, label, and abstract. The subject is a link to the given data. For example a link to Denmark in the data. The label is the actual label of the capital, ie. the city name and the abstract is a short description of the capital. This in turn makes for very usable results if for example a service is used in which a user requests information about Venice. The service would send make a SPARQL query, and the return would actually be information about Venice, because this information is located in the database. Of course one could have the same database in XML format, but it would not be as searchable by the server, since it would then have to find Venice in the XML file, and then access the description property of Venice.